import z from "zod";
import { FileType, MessageType } from '@prisma/client';


const MessageSchemas = {
    sendMessage: z.object({
        body: z.object({
            contactId: z.string(),
            isGroup: z.boolean(),
            content: z.string(),
            type: z.nativeEnum(MessageType).optional(),
            fileSize: z.number().optional(),
            fileName: z.string().optional(),
            fileType: z.nativeEnum(FileType).optional(),
            fileUuid: z.string().optional()
        })
    }),
    download: z.object({
        query: z.object({
            uuid: z.string()
        })
    }),
}

export type SendMessageInput = z.infer<typeof MessageSchemas.sendMessage>['body'];
export type DownloadInput = z.infer<typeof MessageSchemas.download>['query'];

export default MessageSchemas;